package com.weir.myboot.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.weir.myboot.pojo.User;
import com.weir.myboot.service.UserService;

@RestController
public class UserController {
	@Autowired
	private UserService us;
	
	@RequestMapping("/user")
	public String show(Model model,Integer uid){
		User user = us.findUserById(uid);
		model.addAttribute("user",user);
		return "内容："+user.getUsername()+"--"+user.getPassword();
	}
}
